# -*- python -*-
# Copyright 2008 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import platform
import sys
Import('env')

if env.Bit('mac'):
    # there are some issue with compiling ".mm" files
    # TODO(sehr): this should Clone an env specifically for the mm file.
    env.FilterOut(CCFLAGS=['-pedantic'])

nonnacl_util_inputs = [
  'launcher_factory.cc',
  'sel_ldr_launcher_base.cc',
  'sel_ldr_launcher_standalone.cc',
]

if env.Bit('windows'):
  nonnacl_util_inputs += [
      'win/sel_ldr_launcher_win.cc',
  ]
elif env.Bit('linux'):
  nonnacl_util_inputs += [
      'posix/sel_ldr_launcher_posix.cc',
      'posix/sel_ldr_launcher_zygote_posix.cc',
      'posix/get_plugin_dirname.cc',
  ]
elif env.Bit('mac'):
  nonnacl_util_inputs += [
      'posix/sel_ldr_launcher_posix.cc',
      'posix/sel_ldr_launcher_zygote_posix.cc',
      'osx/get_plugin_dirname.mm',
  ]

nonnacl_util_inputs = env.DualObject(nonnacl_util_inputs)

env.DualLibrary('nonnacl_util', nonnacl_util_inputs)
